import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
import { resolve } from "path";

console.log(resolve(__dirname, "/src"), "------------------->")
// https://vitejs.dev/config/
export default defineConfig({
    plugins: [vue()],
    resolve: {
        alias: [
            {
              find: "@",
              replacement: "/src"
            }
        ],
        // alias: {
        //     "@": resolve(__dirname, "/src")
        // }
    },
    publicDir: "empty",
    build: {
        outDir: 'dist/es',
        lib: {
            // 入口文件
            entry: resolve(__dirname, 'src/bundle.js'),
            name: "XqElement",
            fileName: 'xq-element',
            formats: ['es']
        },
        rollupOptions: {
            external: [
                'vue',
                '@fortawesome/fontawesome-svg-core',
                '@fortawesome/free-solid-svg-icons',
                "@fortawesome/vue-fontawesome",
            ]
        }
    }
})
